Add, Count, and Remove Flex Applications in the Flex Launcher
Source code
'************************************************************************************************************************
'Description:
'
'This example opens OpenText Functional Testing with the Web and Flex add-ins and specifies some Flex applications to open.
'It then uses the Count, Item, and Remove methods to determine how many applications are defined and removes all
'applications except the first application.

'This example assumes that there is no unsaved test currently open in OpenText Functional Testing.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************
Dim qtApp 'As QuickTest.Application ' Declare the application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the application object

qtApp.SetActiveAddins Array("Flex", "Web") 'Load the Flex and Web Add-ins
qtApp.Launch ' Start OpenText Functional Testing
qtApp.Visible = True ' Make the OpenText Functional Testing application visible
qtApp.Test.Settings.Launchers("Flex").Active = True ' Instruct OpenText Functional Testing to open specified Flex applications when a record or run session begins

Set flexApps = qtApp.Test.Settings.Launchers("Flex").Applications
HostApplicationTypeValue = 2
flexApps.RemoveAll
flexApps.AddApplicationInFlashPlayer "DummySWF0.swf"
flexApps.AddApplicationInIE32 "DummySWF2.swf"
flexApps.AddApplicationInFlashPlayerWithRuntimeLoader "DummySWF1.swf"

If flexApps.Count > 1 Then
 Set list = CreateObject("System.Collections.ArrayList")
 For Each Iterator In flexApps
  If Iterator.HostApplicationType = HostApplicationTypeValue Then
   list.Add Iterator
  End If
 Next

 For Each i in list
  flexApps.Remove i
 Next
End If

Set qtApp = Nothing 'Release the Application object